#ifndef __GAMEOBJECT_LIST__
#define __GAMEOBJECT_LIST__

#include "GameObjectListInterface.h"
//
// Simple list class for game objects
// Note: size must be reserved befor use.
// Note2: Should be a template class, but that is prohibited in coding guidelines.
//

class GameObject;

class GameObjectList : public GameObjectListInterface
{
public:
	GameObjectList();
	virtual ~GameObjectList();
public:
	virtual void        Reserve(int count);
	virtual void        AddObject(GameObject*);
	virtual void        RemoveObject(GameObject*);
	virtual int         FindObject(GameObject*);
	virtual GameObject* FindObject(int id);
	virtual void        Clear();

	virtual int  GetCount() const;
	virtual int  GetMaxCount() const;
	
	virtual GameObject* operator[](int i);

	GameObject**  m_objects;
	int           m_nObjCount;
	int           m_nMaxCount;

	GameObject*	FindObjectBinary(int id, int start, int end);
	int FindPosBinary(int id, int start, int end);
};

#endif //__GAMEOBJECT_LIST__
